Skip to content

Robustify iptables module - #20

Open
Wescoeur wants to merge 4 commits into
develfrom
ran-robustify-iptables
Open

Wescoeur wants to merge 4 commits into
develfrom
ran-robustify-iptables

Conversation

@Wescoeur

@Wescoeur Wescoeur commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Add 4 commits:

  • Robustify iptables codes check: We must verify specific iptables code to ensure we don't ignore a problem somewhere.
    Note: this change is important for XCP-ng 9, for previous releases we don't use a recent iptables version which have error code 4 (busy lock) for example.
  • Robustify iptables input chain creation: Without this fix, we have a risk that the default firewall input chain is partially created in case of crash, or temporary issue. With this change, the rule is always checked when ports need to be opened.
  • Add checks on iptables command errors.
  • Test update_iptables_tcp_port_range!

@Wescoeur
Wescoeur requested a review from a team September 30, 2026 18:26
Wescoeur added a commit that referenced this pull request Sep 30, 2026
We must verify specific iptables code to ensure we don't ignore a problem somewhere.
Note: this change is important for XCP-ng 9, for previous releases we don't use a
recent iptables version which have error code 4 (busy lock) for example.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Sep 30, 2026
Without this fix, we have a risk that the default firewall input chain
is partially created in case of crash, or temporary issue.

With this change, the rule is always checked when ports need to be opened.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from 1a5de84 to 2c6872d Compare September 30, 2026 18:26
@Wescoeur Wescoeur mentioned this pull request Sep 30, 2026
Comment thread tests/network/test_iptables.py
@Kuruyia
Kuruyia requested a review from a team October 1, 2026 09:47
Wescoeur added a commit that referenced this pull request Oct 1, 2026
We must verify specific iptables code to ensure we don't ignore a problem somewhere.
Note: this change is important for XCP-ng 9, for previous releases we don't use a
recent iptables version which have error code 4 (busy lock) for example.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 1, 2026
Without this fix, we have a risk that the default firewall input chain
is partially created in case of crash, or temporary issue.

With this change, the rule is always checked when ports need to be opened.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 1, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from 2c6872d to 13b7f7f Compare October 1, 2026 19:50
Wescoeur added a commit that referenced this pull request Oct 1, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from 13b7f7f to ece82e8 Compare October 1, 2026 19:55
Wescoeur added a commit that referenced this pull request Oct 1, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from ece82e8 to 5a28510 Compare October 1, 2026 19:59
@Kuruyia
Kuruyia requested a review from a team October 2, 2026 07:50
Wescoeur added a commit that referenced this pull request Oct 2, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 2, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from b463ce3 to 16c6e30 Compare October 2, 2026 10:18
Wescoeur added a commit that referenced this pull request Oct 2, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from 16c6e30 to aac27b1 Compare October 2, 2026 10:19
@Wescoeur

Wescoeur commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

I added a new commit to test update_iptables_tcp_port_range. Now we have a coverage of 100% on this module.
If you want to make a review @Kuruyia . :p

@Wescoeur
Wescoeur requested a review from Kuruyia October 2, 2026 10:21

@Kuruyia Kuruyia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@Kuruyia
Kuruyia requested a review from a team October 2, 2026 11:25
We must verify specific iptables code to ensure we don't ignore a problem somewhere.
Note: this change is important for XCP-ng 9, for previous releases we don't use a
recent iptables version which have error code 4 (busy lock) for example.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Without this fix, we have a risk that the default firewall input chain
is partially created in case of crash, or temporary issue.

With this change, the rule is always checked when ports need to be opened.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 2, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 2, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from aac27b1 to c397411 Compare October 2, 2026 16:36
Wescoeur added a commit that referenced this pull request Oct 7, 2026
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Wescoeur added a commit that referenced this pull request Oct 7, 2026
Executables were run through hardcoded absolute paths, it only works on some distributions.
`ss` is in `/usr/bin` on the GitHub Ubuntu runners, instead of in `/usr/sbin`
on XCP-ng so the LINSTOR controller tests are marked as failed.

Now "/etc/os-release" is used to find alternate OS specific paths instead.

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur force-pushed the ran-robustify-iptables branch from c397411 to 3555e43 Compare October 7, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants